package cn.edu.sdjzu.mocige_server.untils;

import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.security.Keys;

public class SecretKeyGenerator {
    public static void main(String[] args) {
        // 生成符合HS256要求的密钥（至少256位）
        String secret = java.util.Base64.getEncoder().encodeToString(
                Keys.secretKeyFor(SignatureAlgorithm.HS256).getEncoded());
        System.out.println("Generated Secret Key: " + secret);
        System.out.println("Key Length (bytes): " + Keys.secretKeyFor(SignatureAlgorithm.HS256).getEncoded().length);
    }
}
